<!-- toaster directive -->
<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
<!-- / toaster directive -->

<!-- 导航条 -->
<div class="bg-white bread-crumb">
    <ul class="breadcrumb b-a m-b-n-xs lter b-b wrapper-md">
        <li><a ui-sref="main.tpl.homePage"><i class="fa fa-home"></i> 首页</a></li>
        <li><a ui-sref="main.biz.launchplan.planList">推广计划</a></li>
        <li class="active" ng-bind="title"></li>
    </ul>
</div>

<!-- 内容区域 -->
<div class="wrapper-md content">
    <div class="panel panel-default">
        <!-- 头部 -->
        <div class="panel-heading font-bold">{{title}}
            <a class="btn btn-sm btn-icon btn-rounded btn-default pull-right m-t-n-xs" ui-sref="main.biz.launchplan.planList"><i class="text-md fa fa-times text-muted"></i></a>
        </div>

        <!--表单-->
        <div class="panel-body">
            <form class="form-horizontal" name="user_form">
                <div class="form-group">
                    <div class="row">
                        <label class="col-sm-2 control-label pull-right"></label>
                        <label class="col-sm-1 control-label pull-right"><button class="btn btn-danger" ng-if="record.state==2">审核失败</button></label>
                        <label class="col-sm-1 control-label pull-right"><button class="btn btn-success" ng-if="record.state==2">审核通过</button></label>
                    </div>
                </div>

                <div class="form-group">
                    <div class="row">
                        <label class="col-lg-2 col-sm-3 control-label">投放计划:</label>
                        <label class="col-sm-3" style="padding-top: 3px">{{record.planName}}</label>

                        <label class="col-lg-offset-2 col-sm-1 control-label">
                            <a class="btn btn-primary" ui-sref="main.biz.launchplan.setTactics({adPlanId: record.id,planName: record.planName})">策略详情</a>
                        </label>

                        <label ng-if="record.status=='2'" class=" col-sm-1 control-label"><button class="btn btn-success" ng-click="approve(record.id,3)">审核通过</button></label>
                        <label ng-if="record.status=='2'" class=" col-sm-1 control-label"><button class="btn btn-danger" ng-click="approve(record.id,4)">审核失败</button></label>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>

                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label">广告类型:</label>
                    <label class="col-sm-3" style="padding-top: 3px">{{record.valuationType=='1'?"CPC":record.valuationType=='2'?"CPS":record.valuationType=='3'?'CPA':record.valuationType=='4'?'CPM':'CPC'}}</label>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>

                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label">投放日期:</label>
                    <label class="col-sm-3" style="padding-top: 3px">
                        <span ng-show="record.putEndDate=='9999-12-31'">长期投放</span>
                        <span ng-show="record.putEndDate!='9999-12-31'">{{record.putStartDate}}-{{record.putEndDate}}</span>
                    </label>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>

                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label">投放时间段:</label>
                    <label class="col-sm-3" style="padding-top: 3px">
                        {{record.putStartTime}}-{{record.putEndTime}}
                    </label>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>

                <!--<div class="form-group">-->
                    <!--<label class="col-lg-2 col-sm-3 control-label">行业标签:</label>-->
                    <!--<label class="col-sm-3" style="padding-top: 3px">{{record.adTradeContent}}</label>-->
                <!--</div>-->
                <!--<div class="line line-dashed b-b line-lg pull-in"></div>-->

                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label">目标地址:</label>
                    <div class="col-sm-3">{{record.adLinkUrl}}</div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>

                <div ng-show="record.valuationType=='2'" class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label">任务描述:</label>
                    <label class="col-sm-3"></label>
                </div>

                <div ng-show="record.valuationType=='2'" class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label">任务报价:</label>
                    <label class="col-sm-3">

                    </label>
                </div>

                <div ng-show="record.valuationType=='2'" class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label">任务主图:</label>
                    <label class="col-sm-3">

                    </label>
                </div>

                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label">状态:</label>
                    <label class="col-sm-3" style="padding-top: 3px">
                        <span ng-if="record.status=='1'">未提交</span>
                        <span ng-if="record.status=='2'" class="text-danger">待审核</span>
                        <span ng-if="record.status=='3'" class="text-success">审核通过</span>
                        <span ng-if="record.status=='4'">审核失败</span>
                        <span ng-if="record.status=='5'">取消</span>
                    </label>
                </div>

                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label">下属广告:</label>
                    <label class="col-lg-10 col-sm-9">
                        <table class="table table-bordered">
                            <tr class="active">
                                <td>序号</td>
                                <td>渠道名称</td>
                                <td>类型</td>
                                <td >广告位形式</td>
                                <!--<td >位置</td>-->
                                <td >价格</td>
                                <td >图片</td>
                                <td >文字描述</td>
                                <td >日限额</td>
                                <td >总限额</td>
                                <td >状态</td>
                                <td >操作</td>
                            </tr>
                            <tr ng-repeat="item in adSlots">
                                <td>{{$index+1}}</td>
                                <td>{{item.platformName}}</td>
                                <td>{{item.adType}}</td>
                                <td>{{item.adForm}}</td>
                                <!--<td>-->
                                    <!--<a ng-if="item.adPosition != ''&& item.adPosition != null" href="javascript:;" ng-click="showPosWrap(item.id)">立即查看</a>-->
                                    <!--<div class="position" id="PosWrap{{item.id}}" style="position: absolute;display: none;margin-top: -300px;">-->
                                        <!--<div class="pcAdPosWrap" ng-if="item.platformType==='1'">-->
                                            <!--<ul class="pcAdPos clear">-->
                                                <!--<li ng-class="{selected: item.adPosition-1 == $index }" ng-repeat="items in addPosArr.pc">-->

                                                <!--</li>-->
                                            <!--</ul>-->
                                        <!--</div>-->
                                        <!--<div class="mobileAdPosWrap" ng-if="item.platformType==='2'">-->
                                            <!--<ul class="mobileAdPos">-->
                                                <!--<li  ng-class="{selected: item.adPosition-1 == $index }" ng-repeat="items in addPosArr.mobile"></li>-->
                                            <!--</ul>-->
                                        <!--</div>-->
                                    <!--</div>-->


                                <!--</td>-->
                                <td>¥{{item.clickPrice}} / ¥{{item.price}}</td>
                                <td><a ng-if="item.adImg!=''&& item.adImg!=null" href="{{item.adImg}}" target="_blank">立即查看</a></td>
                                <td title="{{item.adContent}}"><span title="{{item.adContent}}" ng-if="item.adContent!=''&& item.adContent!=null">{{item.adContent | limitTo:10}}</span></td>
                                <td>{{item.dailyLimit}}</td>
                                <td>{{item.countLimit}}</td>
                                <td>{{item.state}}</td>
                                <td>
                                    <div type="button" ng-if="item.state==='待审核'&&record.status=='3'" ng-click="approveAd(item.id,3)" class="btn btn-sm btn-primary m-l-xs">
                                    <i class="fa fa-check m-r-xs text-sm"></i>确认</div>

                                    <div type="button" ng-if="item.state==='待审核'&&record.status=='3'" ng-click="approveAd(item.id,4)" class="btn btn-sm btn-danger m-l-xs">
                                        <i class="fa fa-ban m-r-xs text-sm"></i>失败</div>
                                </td>
                            </tr>
                        </table>


                    </label>
                </div>


            </form>
        </div>
    </div>

    <form id="savePlan">
        <div class="modal fade bs-example-modal-lg" tabindex="-1" data-backdrop="static" id="refuseUserSupply" role="dialog" aria-labelledby="gridSystemModalLabelSupply">
            <div class="modal-dialog modal-lg" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title" id="gridSystemModalLabelSupply" ><span id="title"></span>审核</h4>
                    </div>
                    <div class="modal-body">
                        <p></p>
                        <div class="row">
                            <label class="col-sm-2 control-label text-right">拒绝原因:</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" name="approveReason" maxlength="60" placeholder="请输入拒绝原因" ng-model="param.approveReason">
                            </div>
                        </div>
                        <p></p>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="button" class="btn btn-primary" ng-click="saveApproveReason()">确定</button>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div><!-- /.modal -->
    </form>
</div>
